package ee.ut.re;

public class MathUtil {

	public static double sum(double... vals) {
		double acc = 0;
		for (double v : vals) {
			acc += v;
		}
		return acc;
	}

	public static double logDistance(long v1, long v2) {
		return Math.abs(Math.log10(v1) - Math.log10(v2));
		
	}

	public static double booleanDistance(boolean v1, boolean v2) {
		double dV1 = v1 ? 1.0d : 0.0d;
		double dV2 = v2 ? 1.0d : 0.0d;
		return Math.abs(dV1 - dV2);
	}
	
}
